package com.digital.smartgrow.controller.title;

import com.digital.smartgrow.dto.title.*;
import com.digital.smartgrow.service.title.*;
import com.digital.smartgrow.vo.SysResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;


@RestController
@CrossOrigin
@RequestMapping("/commend")
public class CommendHonorController {



    @Autowired
    CommendHonorService commendHonorService;

    @Autowired
    PunishmentService punishmentService;

    @Autowired
    LearningExperienceService learningExperienceService;

    @Autowired
    WorkExperienceService workExperienceService;

    @Autowired
    FurtherStudyService furtherStudyService;

    @Autowired
    AcademicExchangeService academicExchangeService;

    @Autowired
    WorkingConditionsService workingConditionsService;

    @Autowired
    WholeService wholeService;

    @Autowired
    PublishService publishService;

    @Autowired
    ResultService resultService;

    @Autowired
    PracticeService practiceService;

    @Autowired
    CatalogueService catalogueService;











    //任现职以来获何表彰与奖励和荣誉称号
    @GetMapping("/getCommendList")
    public SysResult getCommendList(CommendHonor commend){
        List<CommendHonor> commendHonor = commendHonorService.findList(commend);
        return SysResult.success(commendHonor);
    }
    //任现职以来获何表彰与奖励和荣誉称号删除
    @DeleteMapping("/deleteCommend")
    public SysResult deleteCommend(CommendHonor commendHonor){
        commendHonorService.deleteCommend(commendHonor);
        return SysResult.success();
    }




    //任现职以来受何处分
    @GetMapping("/getpunishmentList")
    public SysResult getpunishmentList(Punishment punishment){
        List<Punishment> punishments = punishmentService.findList(punishment);
        return SysResult.success(punishments);
    }
    //任现职以来受何处分删除
    @DeleteMapping("/deletepunishment")
    public SysResult deletepunishment(Punishment punishment){
        punishmentService.deleteCommend(punishment);
        return SysResult.success();
    }




    //学习经历
    @GetMapping("/getlearningList")
    public SysResult getlearningList(LearningExperience learningExperience){
        List<LearningExperience> learningExperiences = learningExperienceService.findList(learningExperience);
        return SysResult.success(learningExperiences);
    }
    //学习经历删除
    @DeleteMapping("/deletelearning")
    public SysResult deletelearning(LearningExperience learningExperience){
        learningExperienceService.deleteCommend(learningExperience);
        return SysResult.success();
    }




    //工作经历（主要含进修经历）
    @GetMapping("/getworkexperienceList")
    public SysResult getworkexperienceList(WorkExperience workExperience){
        List<WorkExperience> workExperiences = workExperienceService.findList(workExperience);
        return SysResult.success(workExperiences);
    }
    //工作经历删除
    @DeleteMapping("/deleteworkexperience")
    public SysResult deleteworkexperience(WorkExperience workExperience){
        workExperienceService.deleteCommend(workExperience);
        return SysResult.success();
    }



    //进修情况
    @GetMapping("/getfurtherStudyList")
    public SysResult getfurtherStudyList(FurtherStudy furtherStudy){
        List<FurtherStudy> furtherStudies = furtherStudyService.findList(furtherStudy);
        return SysResult.success(furtherStudies);
    }
    //进修情况删除
    @DeleteMapping("/deletefurtherStudy")
    public SysResult deletefurtherStudy(FurtherStudy furtherStudy){
        furtherStudyService.deleteCommend(furtherStudy);
        return SysResult.success();
    }




    //参加学术交流情况
    @GetMapping("/getacademicexchangeList")
    public SysResult getacademicexchangeList(AcademicExchange academicExchange){
        List<AcademicExchange> academicExchanges = academicExchangeService.findList(academicExchange);
        return SysResult.success(academicExchanges);
    }
    //参加学术交流情况删除
    @DeleteMapping("/deleteacademicexchange")
    public SysResult deleteacademicexchange(AcademicExchange academicExchange){
        academicExchangeService.deleteCommend(academicExchange);
        return SysResult.success();
    }




    //任现职以来完成教学工作情况
    @GetMapping("/getworkingConditionsList")
    public SysResult getworkingConditionsList(WorkingConditions workingConditions){
        List<WorkingConditions> workingConditions1 = workingConditionsService.findList(workingConditions);
        return SysResult.success(workingConditions1);
    }
    //任现职以来完成教学工作情况删除
    @DeleteMapping("/deleteworkingConditions")
    public SysResult deleteworkingConditions(WorkingConditions workingConditions){
        workingConditionsService.deleteCommend(workingConditions);
        return SysResult.success();
    }




    //职称申报流程填写
    @GetMapping("/getwholeList")
    public SysResult getwholeList(Whole whole){
        List<Whole> wholes = wholeService.findList(whole);
        return SysResult.success(wholes);
    }
    //职称申报流程填写更新
    @PutMapping("/updatewhole")
    public SysResult updatewhole(Whole whole){
        wholeService.update(whole);
        return SysResult.success();
    }



    //任现职以来发表、出版论文、论著、教材情况
    @GetMapping("/getpublishList")
    public SysResult getpublishList(Publish publish){
        List<Publish> publishes = publishService.findList(publish);
        return SysResult.success(publishes);
    }
    //任现职以来发表、出版论文、论著、教材情况删除
    @DeleteMapping("/deletepublish")
    public SysResult deletepublish(Publish publish){
        publishService.delete(publish);
        return SysResult.success();
    }




    //任现职以来承担并完成科研任务、取得科研成果情况（包括教学研究成果）
    @GetMapping("/getresultsList")
    public SysResult getresultsList(Results results){
        List<Results> results1 = resultService.findList(results);
        return SysResult.success(results1);
    }
    //任现职以来承担并完成科研任务、取得科研成果情况（包括教学研究成果）删除
    @DeleteMapping("/deleteresults")
    public SysResult deleteresults(Results results){
        resultService.delete(results);
        return SysResult.success();
    }



    //任现职以来专业实践情况
    @GetMapping("/getpracticeList")
    public SysResult getpracticeList(Practice practice){
        List<Practice> practices = practiceService.findList(practice);
        return SysResult.success(practices);
    }
    //任现职以来专业实践情况删除
    @DeleteMapping("/deletepractice")
    public SysResult deletepractice(Practice practice){
        practiceService.delete(practice);
        return SysResult.success();
    }



    //任现职以来起草、制定的重要文件、重要报告目录
    @GetMapping("/getcatalogueList")
    public SysResult getcatalogueList(Catalogue catalogue){
        List<Catalogue> catalogues = catalogueService.findList(catalogue);
        return SysResult.success(catalogues);
    }
    //任现职以来起草、制定的重要文件、重要报告目录删除
    @DeleteMapping("/deletecatalogue")
    public SysResult deletecatalogue(Catalogue catalogue){
        catalogueService.delete(catalogue);
        return SysResult.success();//cs
    }


}
